<template>
  <el-container class="home-container">
  <el-header>
    <MuHeader />
  </el-header>
  <el-container class="">
    <el-aside width="200px">
      <MuSide />
    </el-aside>
    <el-main>
      <MuMian />
    </el-main>
  </el-container>
</el-container>
</template>

<script>
import MuHeader from '../componets/musicHeader/MuHeader.vue'
import MuSide from '../componets/side/MuSide.vue'
import MuMian from '../componets/main/MuMian.vue'
export default {
  name: 'Home',
  components: { MuHeader, MuSide, MuMian },
  data() {
    return {
    }
  },
  created() {
    this.getLoginStatus()
    this.getHomepage()
  },
  methods: {
    // 查看登录状态
    async getLoginStatus() {
      // 将cookie 保存到vuex
      const cookieStr = window.sessionStorage.getItem('cookie')
      this.$store.dispatch('getStatus', cookieStr)
      // 将用户信息保存到vuex
      const profileStr = window.sessionStorage.getItem('profile')
      this.$store.dispatch('saveProfile', profileStr)
    },
    async getHomepage() {
      const result = await this.$http.get('/homepage/block/page')
      console.log(result)
    }
  }
}
</script>

<style>
.home-container {
  height: 100%;
}
.el-header {
  background-color: #ef233c;
}
.el-aside {
  background-color: #edf2f4;
}
</style>
